package com.yt.system.dao;

import com.yt.system.domain.Keyresults;
import com.yt.system.domain.ObjectiveKeyresults;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface KeyresultsMapper {
    int deleteByPrimaryKey(Integer krid);

    int insert(Keyresults record);

    int insertSelective(Keyresults record);

    Keyresults selectByPrimaryKey(Integer krid);

    int updateByPrimaryKeySelective(Keyresults record);

    int updateByPrimaryKey(Keyresults record);

    //删除
    @Delete("delete from keyresults where oid = #{value}")
    int DelK(int id);
    //更新
    @Update(" update keyresults set krcontent = #{krcontent} where oid =#{oid}")
    int UpdK(Keyresults kr);
    //插入
    @Insert("INSERT INTO keyresults(krcontent,oid) value (#{krcontent},#{oid})")
    int InsK(Keyresults kr);

    //根据oid查询kr
    @Select("SELECT * FROM keyresults k LEFT JOIN objective o ON k.oid=o.oid WHERE k.oid= #{oid}")
    List<ObjectiveKeyresults> selectKrByOid(int oid);
}